#define _CRT_SECURE_NO_WARNINGS
#include"tree.h"
BTNode* BuyNode(int val)
{
	BTNode* newnode = (BTNode*)malloc(sizeof(BTNode));
	if (newnode == NULL)
	{
		perror("malloc fail!");
		exit(1);
	}
	newnode->data = val;
	newnode->left = newnode->right = NULL;

	return newnode;
}
void CreatTree()
{
	BTNode* n1 = BuyNode(1);
	BTNode* n2 = BuyNode(2);
	BTNode* n3 = BuyNode(3);
	BTNode* n4 = BuyNode(4);

	n1->left = n2;
	n1->right = n3;
	n2->left = n4;

	PreOrder(n1);
}
int main()
{
	CreatTree();
	return 0;
}